package net.cyndeline.rldungeon.dgs.strategy.help

import scalax.collection.immutable.Graph
import net.cyndeline.rldungeon.dgs.graph.Room

/**
 * Replaces represented vertices in a super-graph.
 */
trait SuperGraphVertexReplacerInterface {

  def replaceVertex[RepresentedType <: Room[RepresentedType]]
          (vertexToReplace: RepresentedType,
           replaceWith: RepresentedType,
           graph: Graph[CollapsedNode[RepresentedType], CollapsedEdge[RepresentedType]#Inner]
           ): (Graph[CollapsedNode[RepresentedType], CollapsedEdge[RepresentedType]#Inner], CollapsedNode[RepresentedType], CollapsedNode[RepresentedType])

  def replaceVertexSet[RepresentedType <: Room[RepresentedType]]
  (replacementMapping: Map[RepresentedType, RepresentedType],
   graph: Graph[CollapsedNode[RepresentedType], CollapsedEdge[RepresentedType]#Inner]
    ): (Graph[CollapsedNode[RepresentedType], CollapsedEdge[RepresentedType]#Inner], CollapsedNode[RepresentedType], CollapsedNode[RepresentedType])

  def replaceVertexSetUsingNode[RepresentedType <: Room[RepresentedType]]
  (replacementMapping: Map[RepresentedType, RepresentedType],
   node: CollapsedNode[RepresentedType],
   graph: Graph[CollapsedNode[RepresentedType], CollapsedEdge[RepresentedType]#Inner]
    ): (Graph[CollapsedNode[RepresentedType], CollapsedEdge[RepresentedType]#Inner], CollapsedNode[RepresentedType])
}
